<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/WorkspaceTemplate.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
    </ui:define>

    <ui:define name="right">
       
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:panel id="editAccInfo">
                <h:panelGrid columns="3">
                    <h:outputLabel for="username" value="New username: " />  
                    <p:inputText value="#{accountManagerBean.selectedAccount.username}" 
                                 id="username" required="true" requiredMessage="Username should not be empty." label="username"
                                 validator ="#{accountManagerBean.checkUsernameExists2}">
                        <f:validateLength maximum="10" minimum="1"/>
                    </p:inputText>  
                    <p:message for="username"/>

                    <h:outputLabel for="email" value="New email: " />  
                    <p:inputText value="#{accountManagerBean.selectedAccount.emailAddress}" 
                                 id="email" required="true" requiredMessage="Email should not be empty." label="email"
                                 validator ="#{accountManagerBean.checkEmailExists2}"/>
                    <p:message for="email"/>

                    <h:outputLabel for="status" value="New status * " />  
                    <h:selectOneMenu value="#{accountManagerBean.selectedAccount.status}" 
                                     id="status" required="true" label="status">
                        <f:selectItems value="#{accountManagerBean.allStatus}" var="stt" itemLabel="#{stt}" itemValue="#{stt}"/>
                    </h:selectOneMenu>
                    <p:message for="status"/>

                    <f:facet name="footer">  
                        <p:commandButton value="Submit" action="manageAccounts" ajax="false"
                                         actionListener="#{accountManagerBean.updateEditAccount}" />  
                    </f:facet>
                </h:panelGrid>
            </p:panel>
        </h:form>
    </ui:define>

    <ui:define name="bottom">
       
    </ui:define>

</ui:composition>
